package priv.dajie.tzzq.bot.model;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName C5SteamPackMap
 * @Description 存放从c5获取的steam背包
 * @Author dajie
 * @Date 2019/9/16 2:19 上午
 * @Version V1.0
 **/
public class C5SteamPackItems extends ArrayList<C5SteamPackItem> {

    Map<String, C5SteamPackItem> map = null;

    public synchronized Map<String, C5SteamPackItem> convertToMap(){
        if(map == null){
            map = new HashMap<>();
            for (C5SteamPackItem c5SteamPackItem : this){
                map.put(c5SteamPackItem.getSteamName(), c5SteamPackItem);
            }
        }
        return map;
    }

}
